﻿using MVCDemo.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVCDemo.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        /// <summary>
        /// 一个Action
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(JF jsModel)
        {
            jsModel.Result = jsModel.Num1 + jsModel.Num2;
            return View(jsModel); //将JF对象传递到一个视图（Index.cshtml）里面去
        }

        public ActionResult Index2()
        {
            ViewData["key1"] = "mvc";

            ViewBag.key2 = "MVC";
            return View();
        }
    }
}